<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>找回密码界面</title>
    <link rel="stylesheet" th:href="@{../css/bootstrap.css}" href="../static/css/bootstrap.css">
</head>
<body>
    <form action="forget_password" method="POST" id="forget">
        账号:<input type="text" name="account" placeholder="请输入账号">
        <br>
        新密码:<input type="password" name="password" placeholder="请输入新密码">
        <br>
        手机号:<input type="text" name="phone" placeholder="请输入手机号">
        <br>
        验证码:<input type="text" name="code" placeholder="请输入验证码">
        <br>
        <select name="user">
            <option selected="selected">学生</option>
            <option >老师</option>
        </select>
        <br>
        <input type="button" value="提交" id="submit">
        <input type="reset" value="重置">
    </form>
    <!--静态页面模板-->
    <script th:src="@{/js/jquery-3.3.1.js}" src="../static/js/jquery-3.3.1.js"></script>
    <script th:src="@{/js/bootstrap.js}" src="../static/js/bootstrap.js"></script>
    <script>
        $(document).ready(function () {
           $("#submit").click(function () {
                var formData=new FormData($("#forget")[0]);
                path="forget_password";
                $.ajax({
                    url:path,
                    type:"POST",
                    async:false,
                    processData : false,
                    contentType : false,
                    data:formData,
                    success:function (data) {
                        alert("回调成功");
                        if(data=="true")
                        alert("修改成功");
                        else{
                            alert("修改失败");
                        }
                    },
                    error:function (data) {
                      alert("回调失败");
                    }
                });
           })
        });
    </script>
</body>
</html>